﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CatAndMouse
{
    class Cat : Animal
    {
        public Cat() : base()
        { }

        public Cat(string name) : base(name)
        { }

        public  void Shout()
        {
            string s = string.Format("我是{0},喵 喵 喵",name);
            MessageBox.Show(s);
            if (CatShout != null)
            {
                CatShout();
            }
        }

        public delegate void CatShoutEventHandler();
        public event CatShoutEventHandler CatShout;//委托实例 很像C++里指向成员的函数指针
    }
}
